<?php

/**
 * Created by JetBrains PhpStorm.
 * User: GMC02
 * Date: 9/25/13
 * Time: 4:46 PM
 * To change this template use File | Settings | File Templates.
 */
class HSUrl {

    // region Common
    public static function home() {
        return Yii::app()->getBaseUrl(true);
    }
    // endregion

    // region User
    public static function login() {
        return CHtml::normalizeUrl(array('user/login'));
    }

    public static function loginOpenID($provider = 'facebook') {
        return CHtml::normalizeUrl(array('user/openid', 'provider' => $provider));
    }

    public static function logout() {
        return CHtml::normalizeUrl(array('user/logout'));
    }

    // endregion

    //region BACK-END

    public static function backendUrl() {
        return Yii::app()->BaseUrl . '/backend.php';
    }

    public static function backendDefaultUrl() {
        return HSUrl::backendUrl() . '/site/index';
    }

    public static function backendChangePasswordUrl() {
        return HSUrl::backendUrl() . '/user/changePassword';
    }

    public static function backendLoginUrl() {
        return HSUrl::backendUrl() . '/user/login';
    }

    public static function backendLogoutUrl() {
        return HSUrl::backendUrl() . '/user/logout';
    }

    public static function backendUsersUrl() {
        return HSUrl::backendUrl() . '/user/index';
    }

    public static function backendCreateUsersUrl() {
        return HSUrl::backendUrl() . '/user/create';
    }

    public static function backendUpdatePasswordUserUrl($id) {
        return HSUrl::backendUrl() . '/user/updatePassword?id=' . $id;
    }

    public static function backendCreateTaskUrl() {
        return HSUrl::backendUrl() . '/task/create';
    }

    public static function backendTaskUrl() {
        return HSUrl::backendUrl() . '/task/index';
    }

    public static function backendTaskForUserUrl($user_id) {
        return HSUrl::backendUrl() . '/user/employee?user_id=' . $user_id;
    }

    public static function backendTaskForCurrentUserUrl() {
        return HSUrl::backendUrl() . '/site/task';
    }
    //endregion

}
